<!DOCTYPE html>
<html class="login-bg">
<head>
	<title>E8NET - Find password</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <include file="./App/Admin/View/Include/css.html" />
    <link rel="stylesheet" href="__PUBLIC__/Admin/css/compiled/signup.css" type="text/css" media="screen" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="header">
        <p style="font-size:1.5em; color:#fff;"></p>
    </div>
    <div class="row-fluid login-wrapper">
        <div class="box">
            <div class="content-wrap">

                <h6>请输入新密码并确认此密码</h6>
                <input id="account" type="hidden" name="account" value="{$account}" />
                <input id="role" type="hidden" name="role" value="{$role}" />

                <input class="span12" id="pwd" name="pwd" type="password" placeholder="输入新密码" />
                <input class="span12" id="truepwd" name="truepwd" type="password" placeholder="确认新密码" />

                <span id="msg" style="display: none; color:darkred;">
                    <i class="icon-remove-sign"></i>
                    <small></small>
                </span>

                <div class="action">
                    <a class="btn-flat info" href="javascript:change();">下一步</a>
                </div>                
            </div>
        </div>

    </div>

    <include file="./App/Admin/View/Include/modal.html" />

	<!-- scripts -->
    <script src="__PUBLIC__/Admin/js/jquery-latest.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/Admin/js/theme.js"></script>
    <script src="__PUBLIC__/Admin/js/tools.js"></script>

    <script>

        function change() {

            var account = $('#account').val();
            var role = $('#role').val();
            var pwd = $('#pwd').val();
            var truepwd = $('#truepwd').val();

            if (pwd == "" || truepwd == "") {
                $('#msg > small').html('密码/确认密码不能为空');
                $('#msg').show();
                return;
            }

            if (pwd != truepwd) 
            {
                $('#msg > small').html('两次密码不一致');
                $('#msg').show();
                return;
            }

            lshow();
            $.post("{:U('Findpwd/edit')}",{role:role,account:account,pwd:pwd},
                function(result){
                var obj = eval('(' + result + ')');
                if (obj.result == "RESULT_OK") {
                    window.location.href = obj.data;
                } else {
                    lhide();
                    $('#msg > small').html(obj.msg);
                    $('#msg').show();
                }
            });
        }

    </script>

</body>
</html>